package com.fortune.dao;


import com.fortune.dto.in.mStoreSurplus.MStoreSurplusAddDto;
import com.fortune.dto.in.mStoreSurplus.MStoreSurplusEditDto;
import com.fortune.dto.in.mStoreSurplus.MStoreSurplusInfoDto;
import com.fortune.dto.in.mStoreSurplus.MStoreSurplusListDto;
import com.fortune.vo.mStoreSurplus.MStoreSurplusInfo;
import com.fortune.vo.mStoreSurplus.MStoreSurplusInfoDetail;
import com.fortune.vo.mStoreSurplus.StockDetailSurplus;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

public interface MStoreSurplusDao {

    /**
     * 新增报盈单base
     * @param companyId
     * @param uuid
     * @param uid
     * @param addDto
     * @return
     */
    int addSurplusBase(@Param("companyId") String companyId, @Param("uuid") String uuid, @Param("uid") String uid, @Param("addDto") MStoreSurplusAddDto addDto);


    /**
     * 新增报盈单商品
     * @param companyId
     * @param uuid
     * @param infoDto
     * @return
     */
    int addSurplusDetail(@Param("companyId") String companyId,@Param("uuid") String uuid,@Param("infoDto") MStoreSurplusInfoDto infoDto);


    /**
     * 查询报盈列表
     * @param companyId
     * @return
     */
    List<MStoreSurplusInfo> findSurplusList(@Param("companyId") String companyId, @Param("mStoreSurplusListDto")MStoreSurplusListDto mStoreSurplusListDto);


    /**
     * 查询报盈列表数量
     * @param companyId
     * @param mStoreSurplusListDto
     * @return
     */
    int findSurplusListCount(@Param("companyId") String companyId,@Param("mStoreSurplusListDto")MStoreSurplusListDto mStoreSurplusListDto);


    /**
     * 查看报盈商品详情
     * @param companyId
     * @param deficitId
     * @return
     */
    MStoreSurplusInfoDetail findSurplusInfo(@Param("companyId")String companyId, @Param("deficitId") String deficitId);



    /**
     * 确认报亏
     * @param companyId
     * @param dealerId
     * @param uuid
     * @return
     */
    int editMStoreSurplusConfirm(@Param("companyId") String companyId, @Param("uuid") String uuid,@Param("operatorId")String operatorId);

    /**
     * 删除
     * @param companyId
     * @param dealerId
     * @param uuid
     * @return
     */
    int deleteMStoreSurplus(@Param("companyId") String companyId, @Param("uuid") String uuid);


    /**
     * 编辑报亏单base
     * @param companyId
     * @param addDto
     * @return
     */
    int editSurplusBase(@Param("companyId") String companyId,@Param("editDto") MStoreSurplusEditDto editDto);

    /**
     * 编辑报亏单商品
     * @param companyId
     * @param infoDto
     * @return
     */
    int deleteInfo(@Param("companyId") String companyId,@Param("uuid") String uuid);


    MStoreSurplusAddDto findData(@Param("mid")String mid,@Param("id")String id);

    /**
     * 查库存
     */
    StockDetailSurplus findProductStock(@Param("mid")String mid, @Param("storeId")String storeId, @Param("proId")String proId);

    int addProDuctStock(@Param("mid")String mid, @Param("storeId")String storeId, @Param("proId")String proId, @Param("no")int no, @Param("id")String id, @Param("sNo")int sNo, @Param("num")BigDecimal num,@Param("rainNum")float rainNum);

}
